<template>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad">
      <template
        slot="menuLeft"
        v-if="userInfo.role_name.includes('administrator')||userInfo.role_name.includes('admin')||userInfo.role_name.includes('districtAdmin')||userInfo.role_name.includes('cityAdmin')">
        <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">删除
        </el-button>
        <el-button type="success" size="small" plain icon="el-icon-upload2" @click="handleImport">导入
        </el-button>
        <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出
        </el-button>
      </template>
      <template #menu="{row}">
        <div class="btn-area" v-if="row.status === 2">
          <el-button size="mini" type="success" icon="el-icon-check" @click="auditPass(row)" :loading="auditing">通过
          </el-button>
          <el-button size="mini" type="danger" icon="el-icon-close" @click="auditReject(row)" :loading="auditing">驳回
          </el-button>
        </div>
      </template>
    </avue-crud>
    <el-dialog title="数据导入" append-to-body :visible.sync="excelBox" width="555px">
      <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
        <template slot="excelTemplate">
          <el-button type="primary" @click="handleTemplate">
            点击下载<i class="el-icon-download el-icon--right"></i>
          </el-button>
        </template>
      </avue-form>
    </el-dialog>
  </basic-container>
</template>

<script>
import {getList, getDetail, add, update, remove, auditPassInsti} from "@/api/business/institution";
import NProgress from "nprogress";
import {exportBlob} from "@/api/common";
import {getToken} from "@/util/auth";
import {downloadXls} from "@/util/util";
import {dateNow} from "@/util/date";
import {mapGetters} from "vuex";

export default {
  data() {
    return {
      viewOrNo: false,
      auditing: false,
      excelBox: false,
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      selectionList: [],
      option: {
        columnBtn: false,
        emptyBtn: false,
        labelWidth: 150,
        addBtn: 'administrator',
        height: 'auto',
        calcHeight: 10,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: false,
        viewBtn: true,
        selection: false,
        dialogClickModal: false,
        column: [
          {
            label: "id",
            prop: "id",
            type: "input",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            hide: true,
          },
          {
            label: "注册类型",
            prop: "registerType",
            type: "select",
            dicUrl: "/api/blade-system/dict/dictionary?code=register_type",
            dataType: "string",
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            search: true,
            rules: [{
              required: true,
              message: "请输入注册类型",
              trigger: "blur"
            }],
          },
          {
            label: "医药机构编号",
            prop: "instNo",
            width: 150,
            type: "input",
            addDisplay: false,
            editDisplay: false,
          },
          {
            label: "医药机构名称",
            prop: "instName",
            type: "input",
            search: true,
            searchLabelWidth: 100,
            searchSpan: 6,
            width: 150,
            rules: [{
              required: true,
              message: "请输入医院名称",
              trigger: "blur"
            }],
          },
          {
            label: "地市",
            prop: "city",
            type: "input",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
          },
          {
            label: "区县",
            prop: "district",
            type: "select",
            dicUrl: "/api/blade-system/dict/dictionary?code=medpur_institution",
            dataType: "string",
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            search: true,
            rules: [{
              required: true,
              message: "请输入区县",
              trigger: "blur"
            }],
          },
          {
            label: "医院所有制类型",
            prop: "ownership",
            type: "select",
            dicData: [
              {
                label: "公立",
                value: '公立'
              },
              { value: '民营', label: '民营' },],
            hide: true,
            addDisplay: false,
            rules: [{
              required: true,
              message: "请选择医院所有类型",
              trigger: "blur"
            }],
          },
          {
            label: "登记号",
            prop: "registerNo",
            type: "input",
            width: 180,
            rules: [{
              required: true,
              message: "请输入登记号",
              trigger: "blur"
            }],
          },

          {
            label: "法定代表人",
            prop: "representative",
            type: "input",
            viewDisplay: false,
            addDisplay: false,
            hide: true,
            rules: [{
              required: true,
              message: "请输入法定代表人姓名",
              trigger: "blur"
            }],
          },
          {
            label: "法定代表人身份证",
            prop: "representIdPic",
            type: "upload",
            search: false,
            addDisplay: false,
            span: 24,
            hide: true,
            accept: '.png,.jpeg,.jpg',
            listType: 'picture-img',
            propsHttp: {
              res: 'data',
              url: 'name',
            },
            canvasOption: {
              text: '',
              ratio: 0.1
            },
            action: '/api/blade-resource/oss/endpoint/put-file',
            rules: [{
              required: true,
              message: '请上传法定代表人身份证',
              trigger: 'blur'
            }],
          },
          {
            label: "营业执照编号",
            prop: "licenseNo",
            type: "input",
            addDisplay: false,
            viewDisplay: false,
            hide: true,
            rules: [{
              required: true,
              message: "请输入营业执照编号",
              trigger: "blur"
            }],
            //span: 24,
          },
          {
            label: "营业执照图片上传",
            prop: "licensePic",
            type: "upload",
            hide: true,
            span: 24,
            addDisplay: false,
            listType: 'picture-img',
            propsHttp: {
              res: 'data',
              url: 'name',
            },
            canvasOption: {
              text: '',
              ratio: 0.1
            },
            accept: '.png,.jpeg,.jpg',
            action: '/api/blade-resource/oss/endpoint/put-file',
            rules: [{
              required: true,
              message: '请上营业执照图片',
              trigger: 'blur'
            }],


          },
          {
            label: "联系电话",
            prop: "phone",
            width: 150,
            rules: [{
              required: true,
              message: '请填写联系电话',
              trigger: 'blur'
            }],
          },
          {
            label: "地址",
            prop: "address",
            type: "input",
            width: 180,
            rules: [{
              required: true,
              message: '请填写地址',
              trigger: 'blur'
            }],
          },
          {
            label: "经营性质",
            prop: "busiScope",
            type: "input",
          },
          {
            label: "医药机构类别",
            prop: "category",
            type: "input",
            width: 150,
          },
          {
            label: "医药机构等级",
            prop: "grade",
            type: "input",
          },

          {
            label: "隶属关系",
            prop: "affiliation",
            type: "input",
            hide: true,
          },
          {
            label: "开户银行",
            prop: "bankName",
            type: "input",
            viewDisplay: false,
            hide: true,
            rules: [{
              required: true,
              message: '请输入开户银行名称',
              trigger: 'blur'
            }],
          },
          {
            label: "银行开户名",
            prop: "bankAccountName",
            type: "input",
            viewDisplay: false,
            hide: true,
            rules: [{
              required: true,
              message: '请输入银行开户名',
              trigger: 'blur'
            }],
          },
          {
            label: "银行账号",
            prop: "bankAccount",
            type: "input",
            viewDisplay: false,
            hide: true,
            rules: [{
              required: true,
              message: '请输入银行账号',
              trigger: 'blur'
            }],
          },
          {
            label: "分管医保院领导",
            prop: "insuranceLeader",
            type: "input",
            viewDisplay: false,
            hide: true,
          },
          {
            label: "分管医保院领导电话",
            prop: "insuranceLeaderPhone",
            type: "input",
            viewDisplay: false,
            hide: true,
          },
          {
            label: "医保办负责人",
            prop: "insuranceDuty",
            type: "input",
            hide: true,
          },
          {
            label: "医保办负责人电话",
            prop: "insuranceDutyPhone",
            type: "input",
            hide: true,
          },
          {
            label: "医保办电话",
            prop: "officePhone",
            type: "input",
            hide: true,
          },
          {
            label: "状态",
            prop: "status",
            type: "select",
            dicData: [
              {value: 1, label: '正常'},
              {value: 2, label: '待审批'},
              {value: 3, label: '驳回'},
            ],
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            hide: false,
          },
          {
            label: "创建人",
            prop: "createUser",
            type: "input",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            hide: true,
          },
          {
            label: "创建时间",
            prop: "createTime",
            type: "input",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            hide: true,
          },
          {
            label: "更新人",
            prop: "updateUser",
            type: "input",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            hide: true,
          },
          {
            label: "更新时间",
            prop: "updateTime",
            type: "input",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            hide: true,
          },
          {
            label: "删除标识",
            prop: "isDeleted",
            type: "input",
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            hide: true,
          },
        ]
      },
      data: [],
      excelForm: {},
      excelOption: {
        submitBtn: false,
        emptyBtn: false,
        column: [
          {
            label: '模板上传',
            prop: 'excelFile',
            type: 'upload',
            drag: true,
            loadText: '模板上传中，请稍等',
            span: 24,
            propsHttp: {
              res: 'data'
            },
            tip: '请上传 .xls,.xlsx 标准格式文件',
            action: "/api/institution/import-order"
          },
          {
            label: "数据覆盖",
            prop: "isCovered",
            type: "switch",
            align: "center",
            width: 80,
            dicData: [
              {
                label: "否",
                value: 0
              },
              {
                label: "是",
                value: 1
              }
            ],
            value: 0,
            slot: true,
            rules: [
              {
                required: true,
                message: "请选择是否覆盖",
                trigger: "blur"
              }
            ]
          },
          {
            label: '模板下载',
            prop: 'excelTemplate',
            formslot: true,
            span: 24,
          }
        ]
      }
    };
  },
  created() {
    let district = this.findObject(this.option.column, 'district');
    let instName = this.findObject(this.option.column, 'instName');
    if (this.userInfo.role_name === "medical") {
      district.searchDisabled = true
      instName.searchDisabled = true
      district.searchValue = this.loginUserInfo.institution.district
      instName.searchValue = this.loginUserInfo.institution.instName
    }
  },
  computed: {
    ...mapGetters(["userInfo", "permission", "loginUserInfo", "hasRole"]),
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
    }
  },
  methods: {
    async auditPass(row) {
      this.auditing = true
      try {
        const {data} = await auditPassInsti(row)
        if (data.success) {
          this.onLoad(this.page)
        }
      } finally {
        this.auditing = false
      }
    },
    async auditReject(row) {
      this.auditing = true
      try {
        const {data} = await update({...row, status: 3})
        if (data.success) {
          this.onLoad(this.page)
        }
      } finally {
        this.auditing = false
      }
    },
    rowSave(row, done, loading) {
      add(row).then(() => {
        this.onLoad(this.page);
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
      }, error => {
        loading();
        window.console.log(error);
      });
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(() => {
        this.onLoad(this.page);
        this.$message({
          type: "success",
          message: "操作成功!"
        });
        done();
      }, error => {
        loading();
        console.log(error);
      });
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        });
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
    },
    handleImport() {
      this.excelBox = true;
    },
    uploadAfter(res, done, loading, column) {
      window.console.log(column);
      this.excelBox = false;
      this.refreshChange();
      done();
    },
    handleExport() {
      this.$confirm("是否导出医药机构数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        const {registerType, district, instName} = this.query;
        const params = {
          registerType, district, instName
        };
        const queryStr = Object.entries(params)
          .filter(([key, val]) => val !== undefined) // 过滤掉值为 undefined 的条件
          .map(([key, val]) => `${key}=${val}`)
          .join('&');
        const url = `/api/institution/exportInstitution?${this.website.tokenHeader}=${getToken()}&${queryStr}`;
        NProgress.start();
        exportBlob(url).then(res => {
          downloadXls(res.data, `医药机构数据表${dateNow()}.xlsx`);
          NProgress.done();
        });
      });
    },
    handleTemplate() {
      exportBlob(`/api/institution/export-template?${this.website.tokenHeader
      } = ${getToken()}`).then(res => {
        downloadXls(res.data, "医药机构数据模板.xlsx");
      })
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then(res => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    administrator() {
      console.log("rolename==" + this.userInfo.role_name)
      return this.userInfo.role_name === "admin";
    }
  },
  mounted() {
    if (!this.hasRole('admin') && !this.hasRole('administrator') && !this.hasRole('cityAdmin')) {
      const districtColumn = this.option.column.find(col => col.prop === 'district');
      districtColumn && (districtColumn.search = false)
    }
  },
  watch: {
    'form.registerType': function () {
      //console.log(this.form.registerType);
      if (this.form.registerType === '2') {

        // this.option.column.rules.find(rule => rule.field === 'representIdPic').required = false;
        // this.findObject(this.option.column, 'representIdPic').required = false;
        this.findObject(this.option.column, 'representIdPic').addDisplay = true; ///法定代表人身份证
        this.findObject(this.option.column, 'representIdPic').editDisplay = true;
        this.findObject(this.option.column, 'representIdPic').viewDisplay = true;

        this.findObject(this.option.column, 'representative').addDisplay = true; //法定代表人
        this.findObject(this.option.column, 'representative').editDisplay = true;
        this.findObject(this.option.column, 'representative').viewDisplay = true;

        this.findObject(this.option.column, 'licensePic').addDisplay = true;//营业执照图片上传
        this.findObject(this.option.column, 'licensePic').editDisplay = true;
        this.findObject(this.option.column, 'licensePic').viewDisplay = true;

        this.findObject(this.option.column, 'licenseNo').addDisplay = true;//营业执照编号
        this.findObject(this.option.column, 'licenseNo').editDisplay = true;
        this.findObject(this.option.column, 'licenseNo').viewDisplay = true;

        this.findObject(this.option.column, 'insuranceDuty').viewDisplay = false; //医保办负责人
        this.findObject(this.option.column, 'insuranceDuty').editDisplay = false;
        this.findObject(this.option.column, 'insuranceDuty').addDisplay = false;

        this.findObject(this.option.column, 'insuranceDutyPhone').viewDisplay = false;//医保办负责人电话
        this.findObject(this.option.column, 'insuranceDutyPhone').editDisplay = false;
        this.findObject(this.option.column, 'insuranceDutyPhone').addDisplay = false;

        this.findObject(this.option.column, 'officePhone').viewDisplay = false;//医保办负责人电话
        this.findObject(this.option.column, 'officePhone').editDisplay = false;
        this.findObject(this.option.column, 'officePhone').addDisplay = false;

        this.findObject(this.option.column, 'insuranceLeaderPhone').viewDisplay = false;//分管医保院领导电话
        this.findObject(this.option.column, 'insuranceLeaderPhone').editDisplay = false;
        this.findObject(this.option.column, 'insuranceLeaderPhone').addDisplay = false;

        this.findObject(this.option.column, 'insuranceLeader').viewDisplay = false; //分管医保院领导
        this.findObject(this.option.column, 'insuranceLeader').editDisplay = false;
        this.findObject(this.option.column, 'insuranceLeader').addDisplay = false;

        this.findObject(this.option.column, 'bankAccount').viewDisplay = false;//银行账号
        this.findObject(this.option.column, 'bankAccount').editDisplay = false;
        this.findObject(this.option.column, 'bankAccount').addDisplay = false;

        this.findObject(this.option.column, 'bankName').viewDisplay = false;//银行名称
        this.findObject(this.option.column, 'bankName').editDisplay = false;
        this.findObject(this.option.column, 'bankName').addDisplay = false;

        this.findObject(this.option.column, 'bankAccountName').viewDisplay = false;//银行开户名称
        this.findObject(this.option.column, 'bankAccountName').editDisplay = false;
        this.findObject(this.option.column, 'bankAccountName').addDisplay = false;

        this.findObject(this.option.column, 'affiliation').viewDisplay = false;//隶属关系
        this.findObject(this.option.column, 'affiliation').editDisplay = false;
        this.findObject(this.option.column, 'affiliation').addDisplay = false;

        this.findObject(this.option.column, 'category').viewDisplay = false;//医药机构类别
        this.findObject(this.option.column, 'category').editDisplay = false;
        this.findObject(this.option.column, 'category').addDisplay = false;

        this.findObject(this.option.column, 'grade').viewDisplay = false;//医药机构等级
        this.findObject(this.option.column, 'grade').editDisplay = false;
        this.findObject(this.option.column, 'grade').addDisplay = false;

        this.findObject(this.option.column, 'busiScope').viewDisplay = false;//经营性质
        this.findObject(this.option.column, 'busiScope').editDisplay = false;
        this.findObject(this.option.column, 'busiScope').addDisplay = false;

        this.findObject(this.option.column, 'registerNo').addDisplay = false;
        this.findObject(this.option.column, 'registerNo').editDisplay = false;
        this.findObject(this.option.column, 'registerNo').viewDisplay = false;

        this.findObject(this.option.column, 'ownership').addDisplay = false;
        this.findObject(this.option.column, 'ownership').editDisplay = false;
        this.findObject(this.option.column, 'ownership').viewDisplay = false;


        this.findObject(this.option.column, 'registerNo').rules = [{
          required: false,
          message: "请输入登记号",
          trigger: "blur"
        }];

        this.findObject(this.option.column, 'instName').label = '药店名称';
      } else if (this.form.registerType === '1') {
        this.findObject(this.option.column, 'registerNo').rules = [{
          required: true,
          message: "请输入登记号",
          trigger: "blur"
        }];
        this.findObject(this.option.column, 'representIdPic').addDisplay = false;
        this.findObject(this.option.column, 'representIdPic').editDisplay = false;
        this.findObject(this.option.column, 'representIdPic').viewDisplay = false;

        this.findObject(this.option.column, 'representative').addDisplay = false;
        this.findObject(this.option.column, 'representative').editDisplay = false;
        this.findObject(this.option.column, 'representative').viewDisplay = false;

        this.findObject(this.option.column, 'licensePic').addDisplay = false;
        this.findObject(this.option.column, 'licensePic').editDisplay = false;
        this.findObject(this.option.column, 'licensePic').viewDisplay = false;

        this.findObject(this.option.column, 'licenseNo').addDisplay = false;
        this.findObject(this.option.column, 'licenseNo').editDisplay = false;
        this.findObject(this.option.column, 'licenseNo').viewDisplay = false;


        this.findObject(this.option.column, 'insuranceDuty').viewDisplay = true; //医保办负责人
        this.findObject(this.option.column, 'insuranceDuty').editDisplay = true;
        this.findObject(this.option.column, 'insuranceDuty').addDisplay = true;

        this.findObject(this.option.column, 'registerNo').viewDisplay = true; //
        this.findObject(this.option.column, 'registerNo').editDisplay = true;
        this.findObject(this.option.column, 'registerNo').addDisplay = true;

        this.findObject(this.option.column, 'insuranceDutyPhone').viewDisplay = true;//医保办负责人电话
        this.findObject(this.option.column, 'insuranceDutyPhone').editDisplay = true;
        this.findObject(this.option.column, 'insuranceDutyPhone').addDisplay = true;

        this.findObject(this.option.column, 'officePhone').viewDisplay = true;//医保办电话
        this.findObject(this.option.column, 'officePhone').editDisplay = true;
        this.findObject(this.option.column, 'officePhone').addDisplay = true;

        this.findObject(this.option.column, 'insuranceLeaderPhone').viewDisplay = true;//分管医保院领导电话
        this.findObject(this.option.column, 'insuranceLeaderPhone').editDisplay = true;
        this.findObject(this.option.column, 'insuranceLeaderPhone').addDisplay = true;

        this.findObject(this.option.column, 'insuranceLeader').viewDisplay = true; //分管医保院领导
        this.findObject(this.option.column, 'insuranceLeader').editDisplay = true;
        this.findObject(this.option.column, 'insuranceLeader').addDisplay = true;

        this.findObject(this.option.column, 'ownership').viewDisplay = true; //分管医保院领导
        this.findObject(this.option.column, 'ownership').editDisplay = true;
        this.findObject(this.option.column, 'ownership').addDisplay = true;

        this.findObject(this.option.column, 'bankAccount').viewDisplay = true;//银行账号
        this.findObject(this.option.column, 'bankAccount').editDisplay = true;
        this.findObject(this.option.column, 'bankAccount').addDisplay = true;

        this.findObject(this.option.column, 'bankName').viewDisplay = true;//银行名称
        this.findObject(this.option.column, 'bankName').editDisplay = true;
        this.findObject(this.option.column, 'bankName').addDisplay = true;

        this.findObject(this.option.column, 'bankAccountName').viewDisplay = true;//银行开户名
        this.findObject(this.option.column, 'bankAccountName').editDisplay = true;
        this.findObject(this.option.column, 'bankAccountName').addDisplay = true;

        this.findObject(this.option.column, 'affiliation').viewDisplay = true;//隶属关系
        this.findObject(this.option.column, 'affiliation').editDisplay = true;
        this.findObject(this.option.column, 'affiliation').addDisplay = true;

        this.findObject(this.option.column, 'category').viewDisplay = true;//医药机构类别
        this.findObject(this.option.column, 'category').editDisplay = true;
        this.findObject(this.option.column, 'category').addDisplay = true;

        this.findObject(this.option.column, 'grade').viewDisplay = true;//医药机构等级
        this.findObject(this.option.column, 'grade').editDisplay = true;
        this.findObject(this.option.column, 'grade').addDisplay = true;

        this.findObject(this.option.column, 'busiScope').viewDisplay = true;//经营性质
        this.findObject(this.option.column, 'busiScope').editDisplay = true;
        this.findObject(this.option.column, 'busiScope').addDisplay = true;


        this.findObject(this.option.column, 'instName').label = '医院名称';
      } else {
        this.findObject(this.option.column, 'instName').label = '医药机构名称';
      }
    },
  },
};
</script>

<style></style>
